#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


int removeDuplicates(int nums[], int numsSize)
{
    int str = 0;
    int dst = 0;
    int num = nums[0];//num = 0 num = 1
    while (str < numsSize)
    {

        if (nums[str] != num)
        {
            num = nums[str];

            nums[++dst] = nums[str++];

        }

        else
        {
            str++;

        }
        
    }
    return dst + 1;
}
int main()
{
    int nums[] = {0,0,1,1,1,2,2,3,3,4};
    int numsSize = sizeof(nums) / sizeof(nums[0]);
    removeDuplicates(nums,numsSize);
    for (int i = 0; i < numsSize; i++)
    {
        printf("%d ", nums[i]);
    }
    return 0;
}
